/**
  * This file is part of Medusa.
  *
  * Authors: Uriel Fanelli <uriel.fanelli@gmail.com>
  *          Perthect <perthect@gmail.com>
  *          Marco Bizzarri <Marco.Bizzarri@gmail.com>
  *
  *
  * Medusa is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.

  * Medusa is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.

  * You should have received a copy of the GNU General Public License
  * along with Medusa; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  */


#ifndef GOONGRESS_H
#define GOONGRESS_H
#include <QApplication>
#include <QTreeWidget>
#include <QtWebKit/QWebView>
#include <QtWebKit/QtWebKit>
#include <QWebView>
#include <QWebPage>
#include <QWidget>
#include <iostream>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QBoxLayout>
#include <QNetworkProxy>
#include <QToolBar>
#include <QMenu>
#include <QMenuBar>
#include <QDesktopWidget>
#include <QMainWindow>
#include <QtGui>
#include <QtGui/QStatusBar>
#include <QDockWidget>
#include <QSettings>
#include <QUrl>
#include <QObject>
#include <QTabWidget>
#include <QDialog>
#include <QFileDialog>
#include <QFile>
#include <QDir>

#include <QMetaObject>
#include <QPushButton>

#include <QPlainTextEdit>


///////////////////////////////////////////////////////////////////////////////////////
#include <QtGui/QMainWindow>
#include <QtWebKit>
#include <QFrame>
///////////////////////////////////////////////////////////////////////////////////////


#define COMPANY_NAME "medusa"
#define APPLICATION_NAME "medusa"
#define CONFIG_FORMAT QSettings::IniFormat

#include "gprogressbar.h"
#include "tabwidget.h"
#include "statusbar.h"


///////////////////////////////////////////////////////////////////////////////////////
//#include "myview.h"
#include "tabwidget.h"
#include "tabzone.h"
#include "singletab.h"

class tabWidget;
class tabZone;
class singleTab;
///////////////////////////////////////////////////////////////////////////////////////


//class QTgoongress: public QObject
class QTgoongress: public QMainWindow
{
    Q_OBJECT

    public:
        //QTgoongress();

///////////////////////////////////////////////////////////////////////////////////////
    QTgoongress(QWidget *parent = 0);
    tabWidget *tWidget() const;
    tabZone *currentTab() const;
//    singleTab *currentTab() const;
    QVBoxLayout *midLayout;
///////////////////////////////////////////////////////////////////////////////////////

    private:
        void disegna();
        void popola();
        void createToolBars();
        void createStatusBar();
        void createMenus();
        void createActions();
        void initTree(QSettings *);
        void readTreeFromSettings(QSettings *);
        QSizePolicy makePolicy();
        QHBoxLayout *makeMenuBar();
        QHBoxLayout *makeButtonBar();
        QHBoxLayout *makeTwoColumns();
        QVBoxLayout *makeMainLayout();

        QTreeWidget box;
        QHBoxLayout affiancati;
        QVBoxLayout impilati;
        GProgressBar *progressBar;
        QTAstbar *stbar;
        QLabel *label;
        QWidget *extension;

        QFrame *frame;
        tabWidget *newqtab;


///////////////////////////////////////////////////////////////////////////////////////
        //singleTab *myviewzone;
        //tabWidget *newqtab; // ON OR OFF? IT IS A REPEAT
///////////////////////////////////////////////////////////////////////////////////////


        QMenu *fileMenu;
        QMenu *driveMenu;
        QMenu *helpMenu;

        QToolBar *startToolBar;
        QToolBar *driveToolBar;
        QToolBar *helpToolBar;

        QAction *loginAct;
        QAction *proxyAct;
        QAction *exitAct;
        QAction *quitAct;
        QAction *reloadAct;
        QAction *backAct;
        QAction *forwardAct;
        QAction *stoploadAct;
        QAction *filebroAct;
        QAction *indexAct;
        QAction *searchAct;
        QAction *aboutAct;

    public slots:
        void vai_a(QTreeWidgetItem *, int);
        void about();
        void support();
        void login();

        void proxy();
        void search();
        void quit();
        void pagereload();
        void pageback();
        void pageforward();
        void stopload();
        void filebrowse();

    signals:
        void itemPressed(QTreeWidgetItem *, int);

};

#endif // GOONGRESS_H
